package svgedit.TestSVG;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.awt.Color;
import org.junit.Test;
import svgedit.gui.Frame;
import svgedit.svg.SVGDocument;
import svgedit.svg.SVGLineElement;
import svgedit.svg.SVGPaint;

/**
 * test SVGElement class
 */
class SVGElementTest
{
    
    /**
     * test getDocument() method
     */
    @Test
    public void testgetDocument()
    {
        
        Frame frame = new Frame();
        SVGDocument document;
        document = frame.getDocument();
        SVGLineElement element = new SVGLineElement(document);
        assertTrue(element.getDocument() == document);
    }
    
    /**
     * test getFill() method
     */
    @Test
    public void testgetFill()
    {
        
        Frame frame = new Frame();
        SVGDocument document;
        document = frame.getDocument();
        SVGLineElement element = new SVGLineElement(document);
        SVGPaint fill = new SVGPaint();
        fill.setRGBColor(Color.BLACK);
        assertNotNull(element.getFill());
        assertEquals(fill, element.getFill());
    }
    
    /**
     * test getStroke() method
     */
    @Test
    public void testgetStroke()
    {
        
        Frame frame = new Frame();
        SVGDocument document;
        document = frame.getDocument();
        SVGLineElement element = new SVGLineElement(document);
        SVGPaint stroke = new SVGPaint();
        stroke.setRGBColor(null);
        assertNotNull(element.getFill());
        assertEquals(stroke, element.getStroke());
    }
    
}
